﻿using System;
using System.Collections.Generic;

namespace NMA.Infrastructure.NHibernate.Container
{
    using NMA.Infrastructure.NHibernate.Bootstrapper;     

    public static class IoC
    {
        public static IEnumerable<TService> GetAllInstances<TService>()
        {
            return BootStrapper.Locator.GetAllInstances<TService>();
        }

        public static IEnumerable<object> GetAllInstances(Type serviceType)
        {
            return BootStrapper.Locator.GetAllInstances(serviceType);
        }

        public static TService GetInstance<TService>()
        {
            return BootStrapper.Locator.GetInstance<TService>();
        }

        public static TService GetInstance<TService>(string key)
        {
            return BootStrapper.Locator.GetInstance<TService>(key);
        }

        public static object GetInstance(Type serviceType)
        {
            return BootStrapper.Locator.GetInstance(serviceType);
        }

        public static object GetInstance(Type serviceType, string key)
        {
            return BootStrapper.Locator.GetInstance(serviceType, key);
        }
    }
}